<template>
  <div class="app-container">
    <el-card>
      <div class="operation-module-box" v-for="(item, index) in OPERATION_LIST" :key="index">
        <title-line :title="item.title" />
        <div class="operation-module-list">
          <div
            v-for="(ele, index) in item.list"
            :key="index"
            class="operation-module-item"
            @click="clickHandle(ele.path)"
          >
            <img class="module-item-img" :src="ele.img_url" />
            <div class="module-item-text">
              <h3 class="module-item-title">
                {{ ele.title }}
              </h3>
              <span class="module-item-subtitle">{{ ele.subtitle }}</span>
            </div>
          </div>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
import OPERATION_LIST from './operation'
export default {
  name: 'OperationCenter',
  components: {},
  props: {},
  data() {
    return {}
  },
  computed: {
    OPERATION_LIST() {
      return OPERATION_LIST
    }
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    clickHandle(path) {
      if (path === '') {
        this.$message.info('暂不开放')
        return
      }
      this.$router.push({ path })
    }
  }
}
</script>

<style lang="scss" scoped>
.operation-module {
  &-list {
    display: flex;
    flex-wrap: wrap;
  }
  &-item {
    display: flex;
    align-items: center;
    width: 220px;
    height: 120px;
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 20px;
    background-color: #f7f8fa;
    &:not(:last-child) {
      margin-right: 20px;
    }
    .module-item {
      &-text {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        margin-left: 10px;
        line-height: 30px;
      }
      &-title {
        font-size: 14px;
      }
      &-subtitle {
        color: $hw-text-color-title;
        font-size: 12px;
      }
    }
  }
}
</style>
